import { defineStore } from "pinia";
import { Names } from "../../store-namespace";
import { _get, _post, _put, _delete, http } from "@/utils/axios";
import { sysMDept } from "@/api/backend/index";

export const usePlan = defineStore(Names.plan, {
  state: () => {
    return {
      loading: false,
      query: "", //设备接入企业的id
      single: {
        createBy: null,
        createTime: null,
        cycle: 0,
        ecode: null,
        employeeId: 0,
        employeeIds: null,
        employeeName: "",
        ename: null,
        endTime: "",
        equipmentInfos: [],
        gatewaycode: null,
        groupId: null,
        groupIds: null,
        groupName: null,
        id: 1,
        params: {},
        planName: "",
        planNumber: "",
        remark: null,
        reminderTime: 0,
        searchValue: null,
        skipDate: null,
        skipSaturday: "0",
        skipSunday: "0",
        skipTime11: null,
        skipTime12: null,
        skipTime21: null,
        skipTime22: null,
        startTime: "",
        status: 0,
        stopTime: null,
        unit: "",
        updateBy: null,
        updateTime: null,
      }, //单个企业详情
    };
  },
  getters: {},
  actions: {
    //获取部门下拉框列表信息
    // getDept() {
    //   return new Promise((resolve, reject) => {
    //     _get(sysMDept + "/treeselect", {}, "json", "")
    //       .then((res) => {
    //         console.log(res);
    //         resolve(res);
    //       })
    //       .catch((err) => {
    //         console.log(err);
    //         reject(err);
    //       });
    //   });
    // },
  },
});
